<?php
namespace Org\Util\oauth2;
define('OAUTH_PATH',dirname(__FILE__));
define('DRIVER','Mongo');//数据驱动

class init
{

	static function instance()
	{
		static $oauth;
		$fileName = OAUTH_PATH.DS.'server'.DS.strtolower(DRIVER).DS.DRIVER.'OAuth2.inc';
		$filePath = 'server'.DS.strtolower(DRIVER).DS.DRIVER.'OAuth2.inc';
		$className = DRIVER.'OAuth2';
		if(is_null($oauth))
		{
			if(is_file($fileName))
			{
				require_once($filePath);
				$oauth = new $className;
			}
		}
		return $oauth;
		
	}

}